懂SQL的``请教下`

来源:百度知道 编辑:UC知道 时间:2024/05/22 11:47:21
怎么在SQL中建立ae_server_db!!!

问题没说清楚。
create database ae_server_db ?

建数据库
首先查询是否存在该数据库
if exists(select * from sysdatabases where name='数据库名')
drop database 数据库名
再次
create database 数据库名
on

<数据文件参数>

log on
(
<日志文件参数>
)

建表
if exists(select * from sysobjects where name='表名')
drop table 表名
再次
create table 表名

字段1 数据类型 列的特征,
字段2 数据类型 列的特征,
。。。。

看你给的 ae_server_db!!!,你是想创建数据库吧,我写了个列子你看下,不明白的发我邮箱flyairlf@163.com

在MS-SQL Server 2000中创建一数据库sales。
create database sales
on
( name = sales_dat,
filename = 'F:\flyinfo\saledat.mdf',
size = 1024,
maxsize = 2048,
filegrowth = 512 )
log on
( name = 'sales_log',
filename = 'F:\flyinfo\saledlog.ldf',
size = 512,
maxsize = 1024,
filegrowth = 256 )
--删除数据库
删除数据库的完整语法如下所示: